package com.yumeng.webapp.shiro.service.impl;

import com.yumeng.example.test.dao.TestDao;
import com.yumeng.webapp.shiro.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 *
 * @author wxd
 * @date 2025/11/19 15:18
 */
@Service
//@CacheConfig("testCache1")
public class TestServiceImpl implements TestService {

    @Autowired
    private TestDao testDao;

    @Override
    @Cacheable(value = "testCache1", key = "#id", unless = "#result == null")
    //@Cacheable(key = "#id", unless = "#result == null")
    public Object testCache(String id) {
        return testDao.mapper().selectById(Long.parseLong(id));
    }

}
